home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************************
- *
- *
- * ObjectMacZapp -- a standard Mac OOP application template
- *
- *
- *
- * ZThreadedApplication.cpp -- the threaded application object
- *
- *
- *
- *
- *
- * © 1996, Graham Cox
- *
- *
- *
- *
- *************************************************************************************************/
-
-
- #include "ZThreadedApplication.h"
- #include <Threads.h>
-
-
- Boolean gMacHasThreadManager = FALSE;
-
-
- void ZThreadedApplication::InitMacZoop( const short numMasterBlocks )
- {
- OSErr theErr;
- long tmFeatures;
-
- theErr = Gestalt(gestaltThreadMgrAttr, &tmFeatures);
-
- gMacHasThreadManager = ((theErr == noErr) && (tmFeatures & 1));
-
- // see if threads lib is linked on Powermac
-
- #ifdef __powerc
-
- if (gMacHasThreadManager)
- gMacHasThreadManager = ( YieldToAnyThread != (void*) kUnresolvedCFragSymbolAddress );
-
- #endif
-
- ZApplication::InitMacZoop( numMasterBlocks );
- }
-
-
-
- void ZThreadedApplication::Process1Event()
- {
- ZApplication::Process1Event();
-
- // if we have the thread manager, yield to any thread
-
- if ( gMacHasThreadManager )
- YieldToAnyThread();
- }
-
-
-